/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

@Serializable()
export class UpdateAvatar {
  @JsonProperty('avatar')
    avatar: string = '';

  get body() {
    return {
      avatar: this.avatar,
    };
  }
}

@Serializable()
export class UploadFileResponse {
  @JsonProperty('msg')
    msg: string = '';

  @JsonProperty('fileName')
    fileName: string = '';

  @JsonProperty('code')
    code: number = 0;

  @JsonProperty('url')
    url: string = '';
}

@Serializable()
export default class UploadFile {
  @JsonProperty('fileName')
    fileName: string = '';

  @JsonProperty('file')
    file: File = new File([], this.fileName);

  @JsonProperty('fileSize')
    fileSize: number = 1024 * 1024 * 5; // 5MB

  get query() {
    return {
      file: this.file,
    };
  }
}
